package chapter22.homework04;

import java.util.ArrayList;

public abstract class Subject {
    private ArrayList<Observer> observers = new ArrayList<>();

    public void attach(Observer observer){
        observers.add(observer);//注册方法...
    }

    public void detach(Observer observer){
        observers.remove(observer);//注销方法
    }
    //声明抽象通知方法
    public abstract void notice();
}
